<template>
    <div class="box">
        <div class="box-t tanxin banner">
            <h1>Todolist</h1>
            <div class="box-in">
                <input @keyup.enter="btn(shuchu)" type="text" placeholder="添加ToDo" v-model="shuchu"/>
                <button @click="btn(shuchu)">添加</button>
            </div>
        </div>
    </div>
</template>

<script>

export default {
    data () {
        return {
            shuchu:''
        }
    },
    methods:{
        btn(shuchu){
            this.$store.commit('addin',shuchu)
        }
    },
    // computed:{
    //     list(){
    //         return this.$store.state.arr
    //     }
    // }

}
</script>
 
<style lang = "less" scoped>
@import "../assets/base.less";
.box{
    background-color: #000;
    .box-t{
        height: 40px;
        justify-content: space-between;
        h1{
            color: #fff;
            font-size: 18px;
        }
        input{
            text-indent: 1em;
        }
    }
}    
</style>